package cn.iocoder.yudao.module.biz.dal.mysql.customer.serviceUnit.member;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.customer.serviceUnit.member.ServiceUnitMemberDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.customer.serviceUnit.member.vo.*;

/**
 * 客户档案-服务单元-组员 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ServiceUnitMemberMapper extends BaseMapperX<ServiceUnitMemberDO> {

    default PageResult<ServiceUnitMemberDO> selectPage(ServiceUnitMemberPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ServiceUnitMemberDO>()
                .eqIfPresent(ServiceUnitMemberDO::getServiceUnitId, reqVO.getServiceUnitId())
                .likeIfPresent(ServiceUnitMemberDO::getName, reqVO.getName())
                .betweenIfPresent(ServiceUnitMemberDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ServiceUnitMemberDO::getOwnerUserId, reqVO.getOwnerUserId())
                .orderByDesc(ServiceUnitMemberDO::getId));
    }

}